﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Web;
using WebJudicialAuction.admin.bases;

namespace WebJudicialAuction.admin.handler
{
    /// <summary>
    /// uploadFile 的摘要说明
    /// </summary>
    public class uploadFile : BaseHandler
    {
        public uploadFile()
        {
            IgnoreUserLogin = true;
        }

        protected override AjaxResult BusinessHandleFunc(string req_type, Dictionary<string, string> dicData)
        {
            Thread.Sleep(1500);

            AjaxResult ajaxResult = new AjaxResult();

            HttpPostedFile uploadFile = OwnContext.Request.Files["file"];



            return ajaxResult;
        }

        private string GetSaveName(string fname)
        {
            int i1 = fname.LastIndexOf('.');
            //string frontpart = fname.Substring(0, i1);
            string expart = fname.Substring(i1);
            return Guid.NewGuid().ToString() + expart;
        }

        private string GetExtPart(string fname)
        {
            int i1 = fname.LastIndexOf('.') + 1;
            //string frontpart = fname.Substring(0, i1);
            string expart = fname.Substring(i1);
            return expart;
        }
    }
}